<?php
/*
 * @Author: CHINAKAIYUAN<sunkaiyuan@namenode.cn>
 * @Date: 2022-02-03 01:16:57
 * @LastEditTime: 2023-10-20 13:35:02
 * @LastEditors: 孙开源 && sunkaiyuan@namenode.cn
 * @Description: 其他入库单
 */

namespace App\Models;

use App\Traits\MaterialTrait;

class MpcProYarn extends BaseModel
    {
    use MaterialTrait;
    public $timestamps = true;
    public $table = "sys_mpc_pro_yarn";
    public $attachmentkey = "id";
    public $_auto_resetlot_name = false;
    protected $guarded = [];



    public function details()
        {
        return $this->hasMany(MpcOtherDetail::class, "main_id");
        }
    public function status()
        {
        return $this->belongsTo(Dic::class, "status_id", "key")->where(function ($q)
            {
            $q->where("code", 'StorageOut');
            });
        }
    public function storage()
        {
        return $this->hasMany(ProPlanStorage::class, "main_id");
        }
    public function pro_plan()
        {
        return $this->belongsTo(ProPlan::class);
        }
    }
